﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">

<head>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Reboot to PXE Custom Action</title>
<style type="text/css">
.style1 {
	font-family: Arial, Helvetica, sans-serif;
}
.style3 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: small;
}
.style8 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: medium;
}
h2
	{margin-top:12.0pt;
	margin-right:0in;
	margin-bottom:6.0pt;
	margin-left:0in;
	page-break-after:avoid;
	font-size:14.0pt;
	font-family:"Calibri","sans-serif";
	font-style:italic;
}
h6
	{margin-top:12.0pt;
	margin-right:0in;
	margin-bottom:3.0pt;
	margin-left:.25in;
	page-break-after:avoid;
	font-size:10.0pt;
	font-family:"Calibri","sans-serif";
	font-style:italic;
}
.style10 {
	margin-left: 294px;
	font-family: Arial, Helvetica, sans-serif;
	font-size: small;
}
</style>
</head>

<body>

<p class="style1"><strong>Reboot to PXE Custom Action</strong></p>
<p class="style3">Copyright © Microsoft Corporation. All rights reserved.<br />
THIS CODE SAMPLE IS MADE AVAILABLE TO YOU WITHOUT WARRANTY OF ANY KIND AND 
CONFERS NO RIGHTS ON YOU WHATSOEVER EXCEPT THE RIGHT TO REVIEW IT SOLELY AS A 
REFERENCE. THE ENTIRE RISK OF USE OR RESULTS FROM USE OF THIS CODE SAMPLE 
REMAINS WITH YOU.</p>
<hr />
<p class="style8"><strong>Overview</strong></p>
<p class="style3">There are times during the deployment of a new machine when 
booting to PXE is necessary, such as deployment of a new machine with no 
operating system already on the disk. There are also times where booting to PXE 
multiple times is necessary. Examples include bare-metal server deployment where 
RAID controllers must be reconfigured in BIOS before use or where the controller 
firmware must be flashed before configuring the array. In these cases, the task 
sequence will perform some series of actions, reboot back to PXE, then complete 
some more tasks until the task sequence is finished.</p>
<p class="style3">The issue is that Configuration Manager 2007 does not allow 
the task sequence to reboot back to PXE. It can reboot back to WinPE or to an 
installed OS, both of which require a disk partition and the appropriate 
installed software. Without a disk partition, Configuration Manager will fail 
when attempting to reboot during a task sequence. Additionally, the management 
point tracks when a machine has booted to PXE to run a task sequence, and once a 
machine has booted to PXE for a task sequence, it cannot use PXE as a boot 
method again for that task sequence unless the advertisement is reset.</p>
<p class="style3">So how can you perform a reboot to PXE if you need to within a 
task sequence? Use this custom action. This custom action, written using the 
Configuration Manager 2007 SDK, contains custom code to drive actions in the 
admin console as well as the machine being deployed. This custom action performs 
all the steps necessary to perform the reboot to PXE and allow for proper 
program flow when it occurs.</p>
<hr />
<p class="style8"><strong>How to use this custom action</strong></p>
<p class="style3"><strong>It is important that you start this process from a 
saved task sequence. If you make any modifications to the task sequence without 
saving them and then insert the reboot action, those changes will be lost.</strong></p>
<p class="style3">Once you insert this custom action into the task sequence, you will immediately be 
shown some important information about the action.</p>
<p class="style3">
<img src="images/ClickApplyDialog.jpg" width="586" height="357" /></p>
<p class="style3">If you click <strong>OK</strong>, the task sequence will be 
merged with a template that contains the appropriate reboot steps, and a new 
task sequence will be created. The name of the new task sequence will be 
displayed.</p>
<p class="style3">
<img src="images/Completed%20Dialog.jpg" width="434" height="126" /></p>
<p class="style3">
The action displayed in the task sequence editor will also show that the editor 
must be closed to continue.</p>
<p class="style3">
<img src="images/Completed_Form.jpg" width="432" height="544" /></p>
<hr />
<p class="style3"><strong>Note:</strong> You will need to refresh the view for 
the Task Sequences node to see the new task sequence.</p>
<hr />
<p class="style3">When you open the newly-created task sequence, you&#39;ll notice the changes 
made, which include:</p>
<p class="style3">
<img src="images/Groups%20after%20reboot%20inserted.jpg" width="249" height="529" style="float: left" /></p>
<ol class="style10">
	<li>
	<p class="style3">The &quot;Set RebootStep Variable&quot; action is placed next to the 
	top of the task sequence. This step looks for a computer variable named 
	&quot;RebootStep&quot; and either sets it to 0 (if not found) or increments it by 1.</p>
	</li>
	<li>
	<p class="style3">The group &quot;<strong>Configure Hardware</strong>&quot; is added and 
	several other groups (&quot;<strong>Step </strong><em><strong>n</strong></em>&quot;) 
	are included each of these groups contain tasks which are run depending on 
	the value of the RebootStep variable. During the first boot, actions in Step 
	1 are run. In the second boot, the actions in Step 2 are run, and so on.
	<br />
	<br />
	Some sample Dell server deployment actions are placed in this section as 
	well. You can modify or remove these actions as you need.<br />
	<br />
	<strong>Note:</strong> If you need to add more reboot actions (Reboot to PXE 
	or USB), they will automatically be added between step 2 and step 3, and the 
	values of the RebootStep variable will automatically be incremented.</p>
	</li>
	<li>
	<p class="style3">The actions in <strong>&quot;Deploy Operating System&quot;</strong> 
	group are run only after the actions in the third reboot occur.<br />
	<br />
	</p>
	</li>
	<li>
	<p class="style3">The &quot;<strong>Reset RebootStep Variable</strong>&quot; step 
	is located at the end of the &quot;Deploy Operating System&quot; group to set the 
	variable back to 0. This allows the task sequence to run again from the 
	beginning if you choose to redeploy this computer.</p>
	</li>
</ol>
<p class="style1">&nbsp;</p>
<p class="style1">&nbsp;</p>
<p class="style1">&nbsp;</p>

</body>

</html>
